# Sweep Config

In this article, we will explore ways to configure Sweep. Mainly, we will focus on the `sweep.yaml` file, which is the main configuration file for Sweep.

## Config Table
| Key | Type | Description |
| --- | --- | --- |
| `gha_enabled` | `bool` | Whether or not to enable GitHub Actions |
| `branch` | `str` | The branch to run on |
| `blocked_dirs` | `list` | A list of directories to ignore |
| `draft` | `bool` | Whether or not to create PRs as drafts |
| `description` | `str` | The description of the repository |
| `docs` | `dict` | A dictionary of documentation links |
| `sandbox` | `dict` | Sandbox settings for linting and formatting |

---

## gha_enabled
```yaml
gha_enabled: True
```
Possible Values: True, False

This setting determines whether or not to enable GitHub Actions. If this is set to `False`, then Sweep will not read the results of GitHub Actions.

## branch
```yaml
branch: main
```
This setting determines which branch Sweep will develop from and make pull requests to.

## blocked_dirs
```yaml
blocked_dirs: [".github/", "other_dir"]
```
This setting lists all of the directories that Sweep will not be able to edit. In our example, Sweep is unable to modify the `.github` folder as we do not want Sweep to modify our GitHub Actions.

## draft
```yaml
draft: False
```
Possible Values: True, False

This setting determines whether or not to create pull requests as drafts. If this is set to `True`, then all pull requests will be created as drafts and **GitHub Actions will not be triggered**.

## description
```yaml
description: "project description and standards to follow"
```
This setting is the description of the repository that will be passed to Sweep. Please include details that Sweep may need to understand the repository. You may also include details about standards to follow here.

## docs
```yaml
docs:
  - Modal: https://modal.com/docs/reference
  - PyGitHub: https://pygithub.readthedocs.io/en/latest/
```
This setting contains documentation links that Sweep is able to search through. This is helpful for packages with syntax that has changed or newer packages.

**Important**: Please contact us if you would like to add a documentation link so we can add it to our database.

## sandbox
Python:
```yaml
sandbox:
  enabled: true
  image: "Python3"
  install: "python -m venv venv; . venv/bin/activate; pip install black"
  formatter: ". venv/bin/activate; black {files}"
```

JavaScript/TypeScript
```yaml
sandbox:
  enabled: true
  image: "Nodejs"
  install: "npm install --save-dev prettier"
  formatter: "npx prettier --write {files}"
```

This setting contains sandbox settings for linting and formatting. This is helpful when changes are required to be formatted and tested.

### install
This command is executed when setting up the environment.

### formatter
This command is executed after Sweep changes a file and before Sweep commits the changes. The `{files}` placeholder is replaced with the files that Sweep has changed.

**Important**: Please contact us if you would like to add a sandbox setting, so we can add it to our database.

---

## Our Configuration File
This file is available [here](https://github.com/sweepai/sweep/blob/main/sweep.yaml). We have pasted this file below for your convenience.

```yaml
gha_enabled: True
branch: main
blocked_dirs: [".github/"]
draft: False
description: "sweepai/sweep is a python 3.10 project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8."
docs:
  - Modal: https://modal.com/docs/reference
  - PyGitHub: https://pygithub.readthedocs.io/en/latest/
